package com.casework

import grails.converters.JSON

class HomeController {

//    def elasticSearchService
    def searchableService
    //wrap cache around this
    def index = {
        def numOfCases = LegalCase.count()
        def numOfMeasures = Measure.count()
        def numOfFirms = LegalCaseFirm.withCriteria {
            projections {
                    countDistinct "firm"
                }
            cache true
        }.first()
        def numOfNaces =LegalCaseNaceFullDescription.withCriteria {
            projections {
                    countDistinct "description"
                }
            cache true
        }.first()

        render view:'index', model: [cases: numOfCases, measures: numOfMeasures, firms: numOfFirms, naces: numOfNaces]
    }

    def aboutUs ={}

    def register = {}

	def contactUs = {}

}
